package com.gyp.exception;


import com.gyp.model.common.IResultCode;
import com.gyp.utils.MessageUtils;
import lombok.Data;

/**
 * @description: 华为云接口调用异常
 * @author: xia
 * @createDate: 2020/3/26
 */
@Data
public class RpcException extends RuntimeException {

    private String code;

    private String message;

    public RpcException(String message) {
        this.message = message;
    }

    public RpcException(String format, String... message) {
        String errorMessage = String.format(format,message);
        this.message = errorMessage;
    }

    public RpcException(IResultCode resultCode) {
        this.message = resultCode.getMsg();
        this.code = resultCode.getCode();
    }

    public RpcException(String code, String message) {
        this.message = message;
        this.code = code;
    }

}
